/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 *  Mechanical model to predict stress corrosion crack growth
of stainless steel in high temperature water
 */

/*
 * ProbabilisticGUI.java
 *
 * Created on 22 лют 2010, 16:10:36
 */
package probabilistic.gui;

import probabilistic.Simulation;

/**
 *
 * @author Vitaly
 */
public class ProbabilisticGUI extends javax.swing.JFrame {

    private static final double E10P_3 = 1.0e-3;
    private static final double E10P6 = 1.0e6;
//    SurfaceArea surfaceObj;
    Simulation simuleObj;
    double HeightValue, WidthValue, gWidthValue, gHeightValue;
    double timeMeanValue;
    double timeScaleValue;
    double lengthMean;
    double lengthScale;
    double depthMean;
    double depthScale;
    double valueParametrK;
    double valueYieldStress;
    double valueSigma;
    String textLabel;
    int visualKValue;
    double maxCrackLength;
    int timeIndexMax;
    double aspectRatio;

    /** Creates new form ProbabilisticGUI */
    public ProbabilisticGUI() {
        initComponents();
        gridJPanel1.validate();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Geometry = new javax.swing.JTabbedPane();
        SurfaceArea = new javax.swing.JPanel();
        surfaceHeight = new javax.swing.JTextField();
        height = new javax.swing.JLabel();
        width = new javax.swing.JLabel();
        surfaceWidth = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        gHeight = new javax.swing.JTextField();
        gWidth = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jLabel22 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel25 = new javax.swing.JLabel();
        visualK = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        maxLength = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        Time = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        timeMean = new javax.swing.JTextField();
        timeScale = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        jLabel16 = new javax.swing.JLabel();
        jLabel30 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel18 = new javax.swing.JLabel();
        sigma = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        parametrK = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        yieldStress = new javax.swing.JTextField();
        jLabel26 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        jLabel28 = new javax.swing.JLabel();
        timeIndexHistory = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jLabel29 = new javax.swing.JLabel();
        maxTIndex = new javax.swing.JLabel();
        timeValue = new javax.swing.JLabel();
        jLabel31 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        Crack = new javax.swing.JPanel();
        jLabel11 = new javax.swing.JLabel();
        crackDepthMean = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        dethjLabel = new javax.swing.JLabel();
        crackLengthSkale = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        lengthjLabel = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        crackLengthMean = new javax.swing.JTextField();
        jLabel10 = new javax.swing.JLabel();
        crackDepthSkale = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        jTextFieldAspectRatio = new javax.swing.JTextField();
        submitCrack1 = new javax.swing.JButton();
        jInternalFrame1 = new javax.swing.JInternalFrame();
        gridJPanel1 = new probabilistic.gui.GridJPanel();
        surfaceGeometry = new javax.swing.JLabel();
        menuBar = new javax.swing.JMenuBar();
        fileMenu = new javax.swing.JMenu();
        openMenuItem = new javax.swing.JMenuItem();
        saveMenuItem = new javax.swing.JMenuItem();
        saveAsMenuItem = new javax.swing.JMenuItem();
        exitMenuItem = new javax.swing.JMenuItem();
        editMenu = new javax.swing.JMenu();
        cutMenuItem = new javax.swing.JMenuItem();
        copyMenuItem = new javax.swing.JMenuItem();
        pasteMenuItem = new javax.swing.JMenuItem();
        deleteMenuItem = new javax.swing.JMenuItem();
        helpMenu = new javax.swing.JMenu();
        contentsMenuItem = new javax.swing.JMenuItem();
        aboutMenuItem = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        Geometry.setDoubleBuffered(true);
        Geometry.setOpaque(true);

        surfaceHeight.setText("5");
        surfaceHeight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                surfaceHeightActionPerformed(evt);
            }
        });

        height.setText("Height:");

        width.setText("Width:");

        surfaceWidth.setText("5");
        surfaceWidth.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                surfaceWidthActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel1.setText("Surface");

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel3.setText("Grain");

        gHeight.setText("0.08");
        gHeight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gHeightActionPerformed(evt);
            }
        });

        gWidth.setText("0.08");
        gWidth.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gWidthActionPerformed(evt);
            }
        });

        jLabel4.setText("Height:");

        jLabel5.setText("Width:");

        jLabel21.setText("mm");

        jLabel22.setText("mm");

        jLabel23.setText("mm");

        jLabel24.setText("mm");

        jLabel25.setText("Visual scale:");

        visualK.setText("60000");
        visualK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                visualKActionPerformed(evt);
            }
        });

        jLabel19.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel19.setText("max crack length:");

        maxLength.setText("2.5");

        jLabel27.setText("mm");

        javax.swing.GroupLayout SurfaceAreaLayout = new javax.swing.GroupLayout(SurfaceArea);
        SurfaceArea.setLayout(SurfaceAreaLayout);
        SurfaceAreaLayout.setHorizontalGroup(
            SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SurfaceAreaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(SurfaceAreaLayout.createSequentialGroup()
                        .addComponent(jLabel25)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(visualK, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLabel1)
                    .addComponent(height)
                    .addComponent(width)
                    .addGroup(SurfaceAreaLayout.createSequentialGroup()
                        .addGap(53, 53, 53)
                        .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(surfaceWidth)
                            .addComponent(surfaceHeight, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel22)
                            .addComponent(jLabel21)))
                    .addGroup(SurfaceAreaLayout.createSequentialGroup()
                        .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, SurfaceAreaLayout.createSequentialGroup()
                                .addComponent(jLabel19)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(maxLength))
                            .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, SurfaceAreaLayout.createSequentialGroup()
                                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel5)
                                    .addComponent(jLabel4))
                                .addGap(18, 18, 18)
                                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(gHeight, javax.swing.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                                    .addComponent(gWidth, javax.swing.GroupLayout.DEFAULT_SIZE, 74, Short.MAX_VALUE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel27)
                            .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel23)
                                .addComponent(jLabel24)))))
                .addContainerGap(107, Short.MAX_VALUE))
        );
        SurfaceAreaLayout.setVerticalGroup(
            SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(SurfaceAreaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(24, 24, 24)
                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(SurfaceAreaLayout.createSequentialGroup()
                        .addComponent(height)
                        .addGap(12, 12, 12)
                        .addComponent(width))
                    .addGroup(SurfaceAreaLayout.createSequentialGroup()
                        .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(surfaceHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel21))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(surfaceWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel22))))
                .addGap(18, 18, 18)
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(gHeight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel23))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(gWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel24))
                .addGap(18, 18, 18)
                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(maxLength, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel27))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
                .addGroup(SurfaceAreaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel25)
                    .addComponent(visualK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        Geometry.addTab("Geometry", SurfaceArea);

        jLabel6.setText("Mean:");

        jLabel7.setText("Scale:");

        timeMean.setText("0.0258");
        timeMean.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                timeMeanActionPerformed(evt);
            }
        });

        timeScale.setText("2.97");
        timeScale.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                timeScaleActionPerformed(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel12.setText("Time:");

        jLabel16.setText("Exponential distribution");

        jLabel30.setText("Ms");

        jLabel32.setText("Ms");

        javax.swing.GroupLayout TimeLayout = new javax.swing.GroupLayout(Time);
        Time.setLayout(TimeLayout);
        TimeLayout.setHorizontalGroup(
            TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TimeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(TimeLayout.createSequentialGroup()
                        .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel6)
                            .addComponent(jLabel7))
                        .addGap(18, 18, 18)
                        .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(timeScale)
                            .addComponent(timeMean, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel32)
                            .addComponent(jLabel30)))
                    .addGroup(TimeLayout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 107, Short.MAX_VALUE)
                        .addComponent(jLabel16)))
                .addContainerGap())
        );
        TimeLayout.setVerticalGroup(
            TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(TimeLayout.createSequentialGroup()
                .addGap(6, 6, 6)
                .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel12)
                    .addComponent(jLabel16))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(timeMean)
                    .addComponent(jLabel30))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(TimeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(timeScale)
                    .addComponent(jLabel32))
                .addGap(256, 256, 256))
        );

        Geometry.addTab("Time", Time);

        jLabel18.setText("Stress (sigma):");

        sigma.setText("200");
        sigma.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sigmaActionPerformed(evt);
            }
        });

        jLabel20.setText("MPa");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel18)
                .addGap(18, 18, 18)
                .addComponent(sigma, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel20)
                .addContainerGap(103, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(sigma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20))
                .addContainerGap(299, Short.MAX_VALUE))
        );

        Geometry.addTab("Loading", jPanel1);

        jLabel13.setFont(new java.awt.Font("Tahoma", 2, 11));
        jLabel13.setText("k:");

        parametrK.setText("0.5");

        jLabel17.setText("Yield stress:");

        yieldStress.setText("162");

        jLabel26.setText("MPa");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel13)
                    .addComponent(jLabel17))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(parametrK, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(yieldStress, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jLabel26)))
                .addContainerGap(121, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(parametrK, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(yieldStress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel26))
                .addContainerGap(272, Short.MAX_VALUE))
        );

        Geometry.addTab("Material properties", jPanel2);

        jLabel28.setText("Time Index:");

        timeIndexHistory.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                timeIndexHistoryActionPerformed(evt);
            }
        });

        jButton1.setText("Ok");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel29.setText("max TimeIndex:");

        maxTIndex.setFont(new java.awt.Font("Tahoma", 1, 11));
        maxTIndex.setForeground(new java.awt.Color(255, 0, 0));

        jLabel31.setFont(new java.awt.Font("Tahoma", 0, 14));
        jLabel31.setText("s");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel29)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(maxTIndex, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
                        .addGap(154, 154, 154))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(timeValue, javax.swing.GroupLayout.DEFAULT_SIZE, 178, Short.MAX_VALUE)
                                        .addGap(5, 5, 5))
                                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                                        .addComponent(jLabel28)
                                        .addGap(14, 14, 14)
                                        .addComponent(timeIndexHistory, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addGap(67, 67, 67)
                                        .addComponent(jButton1))
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel31))))
                            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 245, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addContainerGap())))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(17, 17, 17)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel29)
                    .addComponent(maxTIndex, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(timeIndexHistory, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel28)
                    .addComponent(jButton1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(timeValue, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel31))
                .addGap(102, 102, 102))
        );

        Geometry.addTab("History", jPanel3);

        jLabel11.setText("Scale:");

        crackDepthMean.setEditable(false);
        crackDepthMean.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crackDepthMeanActionPerformed(evt);
            }
        });

        jLabel8.setText("Mean:");

        dethjLabel.setText("Depth b:");

        crackLengthSkale.setText("0.03");
        crackLengthSkale.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crackLengthSkaleActionPerformed(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel2.setText("Crack");

        lengthjLabel.setText("Length 2a:");

        jLabel9.setText("Scale:");

        crackLengthMean.setText("0.08");
        crackLengthMean.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crackLengthMeanActionPerformed(evt);
            }
        });

        jLabel10.setText("Mean:");

        crackDepthSkale.setEditable(false);
        crackDepthSkale.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                crackDepthSkaleActionPerformed(evt);
            }
        });

        jLabel14.setText("Normal distribution");

        jLabel15.setText("Normal distribution");

        jLabel33.setText("mm");

        jLabel34.setText("mm");

        jLabel35.setText("mm");

        jLabel36.setText("mm");

        jLabel37.setText("Aspect ratio b/a:");

        jTextFieldAspectRatio.setText("1");

        javax.swing.GroupLayout CrackLayout = new javax.swing.GroupLayout(Crack);
        Crack.setLayout(CrackLayout);
        CrackLayout.setHorizontalGroup(
            CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CrackLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(CrackLayout.createSequentialGroup()
                        .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel2)
                            .addGroup(CrackLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(lengthjLabel))
                            .addGroup(CrackLayout.createSequentialGroup()
                                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel8)
                                    .addGroup(CrackLayout.createSequentialGroup()
                                        .addGap(1, 1, 1)
                                        .addComponent(jLabel9)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(crackLengthSkale)
                                    .addComponent(crackLengthMean, javax.swing.GroupLayout.DEFAULT_SIZE, 80, Short.MAX_VALUE)
                                    .addComponent(jTextFieldAspectRatio, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel14)
                            .addComponent(jLabel33)
                            .addComponent(jLabel34)))
                    .addGroup(CrackLayout.createSequentialGroup()
                        .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(CrackLayout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(dethjLabel))
                            .addGroup(CrackLayout.createSequentialGroup()
                                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel11)
                                    .addComponent(jLabel10))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(crackDepthSkale)
                                    .addComponent(crackDepthMean, javax.swing.GroupLayout.DEFAULT_SIZE, 76, Short.MAX_VALUE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel15)
                            .addComponent(jLabel35)
                            .addComponent(jLabel36)))
                    .addComponent(jLabel37))
                .addContainerGap(37, Short.MAX_VALUE))
        );
        CrackLayout.setVerticalGroup(
            CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(CrackLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lengthjLabel)
                    .addComponent(jLabel14))
                .addGap(8, 8, 8)
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(crackLengthMean, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel8)
                    .addComponent(jLabel33))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(crackLengthSkale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel34))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel37)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTextFieldAspectRatio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(dethjLabel)
                    .addComponent(jLabel15))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(crackDepthMean, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel35))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(CrackLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(crackDepthSkale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel36))
                .addGap(73, 73, 73))
        );

        Geometry.addTab("Crack", Crack);

        submitCrack1.setText("submit");
        submitCrack1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submitCrack1ActionPerformed(evt);
            }
        });

        jInternalFrame1.setMaximizable(true);
        jInternalFrame1.setResizable(true);
        jInternalFrame1.setVisible(true);

        gridJPanel1.setBackground(new java.awt.Color(244, 237, 237));
        gridJPanel1.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3), null));
        gridJPanel1.setDebugGraphicsOptions(javax.swing.DebugGraphics.NONE_OPTION);

        javax.swing.GroupLayout gridJPanel1Layout = new javax.swing.GroupLayout(gridJPanel1);
        gridJPanel1.setLayout(gridJPanel1Layout);
        gridJPanel1Layout.setHorizontalGroup(
            gridJPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 406, Short.MAX_VALUE)
        );
        gridJPanel1Layout.setVerticalGroup(
            gridJPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 384, Short.MAX_VALUE)
        );

        surfaceGeometry.setText(textLabel);

        javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
        jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
        jInternalFrame1Layout.setHorizontalGroup(
            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jInternalFrame1Layout.createSequentialGroup()
                .addGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jInternalFrame1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(surfaceGeometry))
                    .addComponent(gridJPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        jInternalFrame1Layout.setVerticalGroup(
            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jInternalFrame1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(surfaceGeometry)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(gridJPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(227, Short.MAX_VALUE))
        );

        fileMenu.setText("File");

        openMenuItem.setText("Open");
        fileMenu.add(openMenuItem);

        saveMenuItem.setText("Save");
        fileMenu.add(saveMenuItem);

        saveAsMenuItem.setText("Save As ...");
        fileMenu.add(saveAsMenuItem);

        exitMenuItem.setText("Exit");
        exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitMenuItemActionPerformed(evt);
            }
        });
        fileMenu.add(exitMenuItem);

        menuBar.add(fileMenu);

        editMenu.setText("Edit");

        cutMenuItem.setText("Cut");
        editMenu.add(cutMenuItem);

        copyMenuItem.setText("Copy");
        editMenu.add(copyMenuItem);

        pasteMenuItem.setText("Paste");
        editMenu.add(pasteMenuItem);

        deleteMenuItem.setText("Delete");
        editMenu.add(deleteMenuItem);

        menuBar.add(editMenu);

        helpMenu.setText("Help");

        contentsMenuItem.setText("Contents");
        helpMenu.add(contentsMenuItem);

        aboutMenuItem.setText("About");
        helpMenu.add(aboutMenuItem);

        menuBar.add(helpMenu);

        setJMenuBar(menuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jInternalFrame1)
                .addGap(84, 84, 84)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(Geometry, javax.swing.GroupLayout.PREFERRED_SIZE, 314, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(submitCrack1, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(60, 60, 60))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jInternalFrame1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addComponent(Geometry, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(submitCrack1)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void crackLengthMeanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crackLengthMeanActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_crackLengthMeanActionPerformed

    private void surfaceHeightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_surfaceHeightActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_surfaceHeightActionPerformed

    private void gHeightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gHeightActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_gHeightActionPerformed

    private void gWidthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gWidthActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_gWidthActionPerformed

    private void submitCrack1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitCrack1ActionPerformed
        // TODO add your handling code here:        
        getParametrsForGridJPanel1();

    }//GEN-LAST:event_submitCrack1ActionPerformed

    private void timeMeanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeMeanActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_timeMeanActionPerformed

    private void timeScaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeScaleActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_timeScaleActionPerformed

    private void crackLengthSkaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crackLengthSkaleActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_crackLengthSkaleActionPerformed

    private void crackDepthMeanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crackDepthMeanActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_crackDepthMeanActionPerformed

    private void crackDepthSkaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_crackDepthSkaleActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_crackDepthSkaleActionPerformed

    private void sigmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sigmaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_sigmaActionPerformed

    private void surfaceWidthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_surfaceWidthActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_surfaceWidthActionPerformed

    private void timeIndexHistoryActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeIndexHistoryActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_timeIndexHistoryActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        int timeIndexHistoryValue = (Integer.parseInt(timeIndexHistory.getText()));
        gridJPanel1.getSimulObj().getPaintedCracks(timeIndexHistoryValue);
        timeValue.setText(gridJPanel1.getSimulObj().getTime().getInitTime().get(timeIndexHistoryValue).toString());
        gridJPanel1.paintComponent(gridJPanel1.getGraphics());
        gridJPanel1.repaint();
    }//GEN-LAST:event_jButton1ActionPerformed

    private void visualKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_visualKActionPerformed
        // TODO add your handling code here:
        visualKValue = (Integer.parseInt(visualK.getText()));
        gridJPanel1.getSimulObj().setVisualScale(visualKValue);
        gridJPanel1.paintComponent(gridJPanel1.getGraphics());
        jInternalFrame1.validate();
//        jScrollPane1.validate();
//        gridJPanel1.invalidate();
//        //this.validateTree();
//        jScrollPane1.repaint();
        jInternalFrame1.repaint();
    }//GEN-LAST:event_visualKActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                ProbabilisticGUI obj = new ProbabilisticGUI();
//                obj.getParametrsForGridJPanel1();
                obj.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Crack;
    private javax.swing.JTabbedPane Geometry;
    private javax.swing.JPanel SurfaceArea;
    private javax.swing.JPanel Time;
    private javax.swing.JMenuItem aboutMenuItem;
    private javax.swing.JMenuItem contentsMenuItem;
    private javax.swing.JMenuItem copyMenuItem;
    private javax.swing.JTextField crackDepthMean;
    private javax.swing.JTextField crackDepthSkale;
    private javax.swing.JTextField crackLengthMean;
    private javax.swing.JTextField crackLengthSkale;
    private javax.swing.JMenuItem cutMenuItem;
    private javax.swing.JMenuItem deleteMenuItem;
    private javax.swing.JLabel dethjLabel;
    private javax.swing.JMenu editMenu;
    private javax.swing.JMenuItem exitMenuItem;
    private javax.swing.JMenu fileMenu;
    private javax.swing.JTextField gHeight;
    private javax.swing.JTextField gWidth;
    private probabilistic.gui.GridJPanel gridJPanel1;
    private javax.swing.JLabel height;
    private javax.swing.JMenu helpMenu;
    private javax.swing.JButton jButton1;
    private javax.swing.JInternalFrame jInternalFrame1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jTextFieldAspectRatio;
    private javax.swing.JLabel lengthjLabel;
    private javax.swing.JTextField maxLength;
    private javax.swing.JLabel maxTIndex;
    private javax.swing.JMenuBar menuBar;
    private javax.swing.JMenuItem openMenuItem;
    private javax.swing.JTextField parametrK;
    private javax.swing.JMenuItem pasteMenuItem;
    private javax.swing.JMenuItem saveAsMenuItem;
    private javax.swing.JMenuItem saveMenuItem;
    private javax.swing.JTextField sigma;
    private javax.swing.JButton submitCrack1;
    private javax.swing.JLabel surfaceGeometry;
    private javax.swing.JTextField surfaceHeight;
    private javax.swing.JTextField surfaceWidth;
    private javax.swing.JTextField timeIndexHistory;
    private javax.swing.JTextField timeMean;
    private javax.swing.JTextField timeScale;
    private javax.swing.JLabel timeValue;
    private javax.swing.JTextField visualK;
    private javax.swing.JLabel width;
    private javax.swing.JTextField yieldStress;
    // End of variables declaration//GEN-END:variables

    void getParametrsForGridJPanel1() {
        maxCrackLength = (Double.parseDouble(maxLength.getText())) * E10P_3;
        visualKValue = (Integer.parseInt(visualK.getText()));
        HeightValue = (Double.parseDouble(surfaceHeight.getText())) * E10P_3;
        WidthValue = (Double.parseDouble(surfaceWidth.getText())) * E10P_3;
        gWidthValue = (Double.parseDouble(gWidth.getText())) * E10P_3;
        gHeightValue = (Double.parseDouble(gHeight.getText())) * E10P_3;
        timeMeanValue = Double.parseDouble(timeMean.getText()) * E10P6;
        timeScaleValue = Double.parseDouble(timeScale.getText()) * E10P6;
        lengthMean = Double.parseDouble(crackLengthMean.getText()) * E10P_3;
        lengthScale = Double.parseDouble(crackLengthSkale.getText()) * E10P_3;
        try {
            depthMean = Double.parseDouble(crackDepthMean.getText()) * E10P_3;
            depthScale = Double.parseDouble(crackDepthSkale.getText()) * E10P_3;
        } catch (Exception e) {
        }

        valueParametrK = Double.parseDouble(parametrK.getText());
        valueYieldStress = Double.parseDouble(yieldStress.getText()) * E10P6;
        valueSigma = Double.parseDouble(sigma.getText()) * E10P6;
        try {
            aspectRatio = Double.parseDouble(jTextFieldAspectRatio.getText());
        } catch (Exception e) {
        }

        try {
            simuleObj.getPersistObj().close(true);
        } catch (Exception e) {
        }

        simuleObj = new Simulation(HeightValue, WidthValue, gHeightValue,
                gWidthValue, timeMeanValue, timeScaleValue, valueSigma,
                valueYieldStress, valueParametrK, maxCrackLength, visualKValue);

        simuleObj.FillRandomCracks(lengthMean, lengthScale, depthMean, depthScale, aspectRatio);


        gridJPanel1.setSimulObj(simuleObj);
        gridJPanel1.paintComponent(gridJPanel1.getGraphics());

        surfaceGeometry.setText("hxw surface=" + gridJPanel1.getSurface().getHeight() + "x"
                + gridJPanel1.getSurface().getWidth() + " " + "grain=" + gridJPanel1.getSurface().getGrainHeight() + "x"
                + gridJPanel1.getSurface().getGrainWidth() + " Nmax =" + gridJPanel1.getSurface().getNmax());


        timeIndexHistory.setText(gridJPanel1.getSimulObj().getMaxTimeIndxS());
        maxTIndex.setText(gridJPanel1.getSimulObj().getMaxTimeIndxS());
        timeValue.setText(gridJPanel1.getSimulObj().getTime().getInitTime().get(gridJPanel1.getSimulObj().getMaxTimeIndx()).toString());



    }
}
